#ifndef __IRR_I_NETWORK_DRIVER_H_INCLUDED__
#define __IRR_I_NETWORK_DRIVER_H_INCLUDED__

#include "irrTypes.h"
#include "IUnknown.h"
#include "INetworkCallback.h"
#include "ISocketLow.h"

namespace game
{
	namespace net
	{
		//! Interface of the network driver
		class INetworkDriver : public irr::IUnknown
		{

		public:
			virtual ~INetworkDriver()
			{
			}

			//! Initialize the wifi connections
			/**
			\param ApctlIndex: apctl config index
			\param NetworkCallback: an object that extends the INetworkCallback interface
			\return Returns true if wifi was succesfully initialized */
			virtual void initialize(INetworkCallback *NetworkCallback, int ApctlIndex = 1) = 0;

			//! Close the wifi connection
			virtual void disconnectApctl() = 0;

			//! Create a socket
			/** \param HostName: hostname or ip address to connect to, if this param is ommitted the socket will not be connected
			\param Port: the port number
			\return Returns the created socket
			*/
			virtual ISocketLow* createSocket(c8 *hostName = 0, int port = 0) = 0;

            virtual void run()=0;

			//! Get the socket with the index specified
			//! \param Index: the socket index you want to get
			//! \return Returns the socket class
			virtual ISocketLow* getSocketByIndex(int index) = 0;

			//! Gets the local ip
			//! \return Return the local ip address
			virtual irr::core::stringc& getLocalAddress() = 0;

			virtual void removeSocket(ISocketLow *socket) = 0;

			virtual bool getConnectionInitialized() = 0;

			virtual INetworkCallback* getNetworkCallback() = 0;

		};
	}
}
#endif
